{if $context=="list" || $context=="dependslist"}

	{* ОТОБРАЖАЕМ МАТЕРИАЛЫ В СГРУППИРОВАННОМ ПО РАЗДЕЛАМ ВИДЕ *}

	{if $options.groupby!="no"}
	
		{foreach from=$content.resources item=category}
			{if $category.resources}
			
            <div {if $options.color!="default"} class="widget {$options.color}"{/if}>
				
            	{if ($content.resources|@count>1 && $options.groupby=="yes3") || $options.groupby=="yes1"}
					<h3>{$category.categoryname}</h3>
				{/if}
				
                {if $options.template=="default"}<div class="content_list">{/if}
                {if $options.template=="2columns"}<div class="content_list_2">{/if}
                {if $options.template=="3columns"}<div class="content_list_3">{/if}
                {if $options.template=="4columns"}<div class="content_list_4">{/if}
                
					<ul>
						{foreach from=$category.resources item=item name=foo}
							<li>
								
								{if $options.showimg=="yes" && $item.image}
                                	{if $options.template=="4columns"}
										<div class="img_col_4"><img src="{$cnf.baseurl}/images/resources/medium/{$item.image}" border="0"  alt="{$item.resourcename}" /></div>
                                        <div class="img_col_4_hight"></div>
									{/if}
									{if $options.template=="3columns"}
										<img src="{$cnf.baseurl}/images/resources/medium/{$item.image}" border="0" width="95%" alt="{$item.resourcename}" />
									{/if}
									{if $options.template=="2columns"}
										<img src="{$cnf.baseurl}/images/resources/medium/{$item.image}" border="0" width="150px" alt="{$item.resourcename}" />
									 {else if $options.template=="default"}
                     					<div class="img_col"><img src="{$cnf.baseurl}/images/resources/medium/{$item.image}" border="0" alt="{$item.resourcename}"  /></div>
									{/if}
								{/if}
								
								<div class="head">
                                	{if $item.resourcetxt}
                               			<a href="{$cnf.baseurl}{$item.fullpath}{$item.resourceid}.html">{$item.resourcename}</a>
                              	  	{else}
                                		{$item.resourcename}
                                	{/if}
                                </div>
                                
								{if $options.showdescr=="yes"}
									<div class="descrtext">{$item.resourcedescr}</div>
								{/if}
                                
                                {if $options.showdate=="datetime"}
									<div class="newsdate">{$item.pubdate|date_format:"%d.%m.%Y %H:%M"}</div>
								{else if $options.showdate=="date"}
									<div class="newsdate">{$item.pubdate|date_format:"%d.%m.%Y"}</div>
								{/if}
								{if $options.template=="default"}<div class="clear"></div>{/if}
							</li>
	
							{if $smarty.foreach.foo.index%4==3 && $options.template=="4columns"}
								<li class="recall"></li>
							{else if $smarty.foreach.foo.index%3==2 && $options.template=="3columns"}
								<li class="recall"></li>
							{else if $smarty.foreach.foo.index%2==1 && $options.template=="2columns"}
								<li class="recall"></li>
							{/if}
							
						{/foreach}
					</ul>
					
					<div class="clear"></div>
					
				</div>
				
			</div>
			
			{/if}
		{/foreach}
	
	{* ОТОБРАЖАЕМ МАТЕРИАЛЫ В ВИДЕ СПИСКА *}
	
	{else}
	
		{if $content.paginator}
			{assign var=Paginator value=$content.paginator}
			{include file="default/helpers/paginator.tpl"}
		{/if}
	
		{if $content.resources}
		
			<div {if $options.color!="default"} class="widget {$options.color}"{/if}>
	        
				{if $options.subtitle}<h2>{$options.subtitle}</h2>{/if}
				
				{if $options.paginate=="top" || $options.paginate=="all"}
					{$smarty.capture.Paginate}
				{/if}
	            
				{if $options.template=="default"}<div class="content_list">{/if}
				{if $options.template=="2columns"}<div class="content_list_2">{/if}
				{if $options.template=="3columns"}<div class="content_list_3">{/if}
				{if $options.template=="4columns"}<div class="content_list_4">{/if}
	                
					<ul>
					
					{foreach from=$content.resources item=item name=foo}
					
						<li>
				
						{if $options.showimg=="yes" && $item.image}
		                    {if $options.template=="3columns"}
								<div class="img_col_3"><img src="{$cnf.baseurl}/images/resources/medium/{$item.image}" border="0" alt="{$item.resourcename}" /></div>
		                    	<div class="img_col_3_hight"></div>
		                    {else if $options.template=="4columns"}
								<div class="img_col_4"><img src="{$cnf.baseurl}/images/resources/medium/{$item.image}" border="0" alt="{$item.resourcename}" /></div>
		                    	<div class="img_col_4_hight"></div>
		                    {else if $options.template=="default"}
								<div class="img_col"><img src="{$cnf.baseurl}/images/resources/medium/{$item.image}" border="0" alt="{$item.resourcename}" /></div>
		                    {else}
		                    	<div><img src="{$cnf.baseurl}/images/resources/medium/{$item.image}" border="0" alt="{$item.resourcename}" /></div>
							{/if}
	                    {/if}
					
						
						<div {if $options.showdescr=="yes"}class="head"{/if}>
	                    	<a href="{$cnf.baseurl}{$item.fullpath}{$item.resourceid}.html">{$item.resourcename}</a>
	                    </div>
						
						{if $options.showdescr=="yes"}
							<div>{$item.resourcedescr}</div>
						{/if}
	                    
	                    {if $options.showdate=="datetime"}
							<div class="newsdate">{$item.pubdate|date_format:"%d.%m.%Y %H:%M"}</div>
						{else if $options.showdate=="date"}
							<div class="newsdate">{$item.pubdate|date_format:"%d.%m.%Y"}</div>
						{/if}
						{if $options.template=="default"}<div class="clear"></div>{/if}
						
						</li>
	                
		                {if $smarty.foreach.foo.index%4==3 && $options.template=="4columns"}
							<li class="recall"></li>
						{else if $smarty.foreach.foo.index%3==2 && $options.template=="3columns"}
							<li class="recall"></li>
						{else if $smarty.foreach.foo.index%2==1 && $options.template=="2columns"}
							<li class="recall"></li>
						{/if}
		
					{/foreach}
					
					</ul>
		           
		            <div class="clear"></div>
	            
				</div>

				{if $options.paginate=="bottom" || $options.paginate=="all"}
					{$smarty.capture.Paginate}
				{/if}
				
			</div>
		
		{/if}
	
	{/if}

{/if}
